import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '员工',
    align:"center",
    dataIndex: 'staffId_dictText'
   },
   {
    title: '职位',
    align:"center",
    dataIndex: 'postion'
   },
  /*{
    title: '所在项目',
    align:"center",
    dataIndex: 'projectId_dictText'
  },*/
   {
    title: '成本',
    align:"center",
    dataIndex: 'cost'
   },
   {
    title: '当前工作量',
    align:"center",
    dataIndex: 'usePercent'
   },
 /*  {
    title: '开始时间',
    align:"center",
    dataIndex: 'startTime'
   },
   {
    title: '使用结束时间',
    align:"center",
    dataIndex: 'endTime'
   },
   {
    title: '工作内容',
    align:"center",
    dataIndex: 'content'
   },*/
];
//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    field: 'staffId',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'monster_staff,name,id'
    },
    label: '员工',
    colProps: { span: 4 },
  },
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '员工ID',
    field: 'staffId',
    component: 'Input',
  },
  {
    label: '职位',
    field: 'postion',
    component: 'Input',
  },
  {
    label: '成本',
    field: 'cost',
    component: 'InputNumber',
  },
  {
    label: '当前工作量',
    field: 'usePercent',
    component: 'InputNumber',
  },
  {
    label: '开始时间',
    field: 'startTime',
    component: 'Input',
  },
  {
    label: '使用结束时间',
    field: 'endTime',
    component: 'DatePicker',
    componentProps: {
       showTime: true,
       valueFormat: 'YYYY-MM-DD HH:mm:ss'
     },
  },
  {
    label: '工作内容',
    field: 'content',
    component: 'Input',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];



/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}
